<%@ page language="java" import="java.util.*,com.chj.entity.*"  pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心</title>
<link href="css/bootstrap.min.css"rel="stylesheet" type="text/css">
<link href="css/evtcar.css" rel="stylesheet" type="text/css" />
<link href="css/person/userInf.css" rel="stylesheet" type="text/css" />
<link href="css/font-awesome-4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="css/person/register.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="js/login.js" charset="utf-8"></script>
<script type="text/javascript" src="js/jquery-2.1.3.min.js"></script>
<script src="js/staticinfo.js"></script>
</head>
<body>
<!--顶部导航栏开始 -->
<%@include file="head.jsp" %>
<!--下面是中部导航栏的代码-->
<div class="nav-green nav-head" id="J_m_nav">
	<div class="nav-content">
		<div class="nav-btn "><a href="index.do">首页</a></div>
		<div class="nav-btn"><a href="ecarcharge/we_need_charge.do">我要充电</a></div>
        <div class="nav-btn active"><a href="person/person_center.do">个人中心</a></div>
        <div class="nav-btn"><a href="about_me.do">关于我们</a></div>
        <div class="nav-btn"><a href="person/person_help.do">用户帮助</a></div>
	</div>
</div>
</header>
<!--顶部导航栏结束 -->
		<div class="main">
			<div class="newcontainer">
				<div id="user-card">
					<div class="inners clearfix without-side">
						<div class="head-line">
							<div class="name"><%=user.getUserName() %></div>
						</div>
		                <div class="user-inf">
		                    <ul class="introduction">
		                        <li><i class="fa fa-phone-square" style="font-size: 20px;"></i><%=user.getUserPhone() %></li><br/>
		                        <li><i class="fa fa-file-text"  style="font-size: 20px;"></i><%=user.getUserEmail()%></li>
		                    </ul>
		                </div>
						<div class="bindings">
							<div class="fast-item">
								<a href="person/person_msg.do" class="btn">
									<div class="img">
										<i class="fa fa-calendar fa-3x"></i>
									</div>消息提醒 </a>
								<a href="person/person_order_manager.do" class="btn">
									<div class="img">
										<i class="fa fa-shopping-cart fa-3x"></i>
									</div>订单管理 </a>
								<a href="person/person_ecar.do" class="btn">
									<div class="img">
										<i class="fa fa-desktop fa-3x"></i>
									</div>我的电动汽车 </a>
								</a>
								<a href="person/person_update.do" class="btn without-side">
									<div class="img">
										<i class="fa fa-info-circle fa-3x"></i>
									</div>我的资料 </a>
							</div>
						</div>
					</div>
				</div>
				<div id="chargemessage">
					<div class="title">
						消息提醒
					</div>
					<div class="inf">
						<!--panel面板的标题，下同-->
						<div class="containbox">
							<div class="panel panel-primary">
								<!--panel面板的标题，下同-->
								<div class="panel-heading" id="msg">
									<h3 class="panel-title">
										最新提醒
									</h3>
								</div>
								<!--panel面板的内容，下同-->
								<div class="panel-body" id="msgContent">

								</div>
							</div>
						</div>
						<!--panel面板的标题，下同-->
						<div class="containbox">
							<div class="panel panel-primary">
								<!--panel面板的标题，下同-->
								<div class="panel-heading" id="oldmsg">
									<h3 class="panel-title">
										历史提醒
									</h3>
								</div>
								<!--panel面板的内容，下同-->
								<div class="panel-body" id="oldMsgContent">

								</div>
							</div>
						</div>
					</div>
				</div>

		</div>
     </div>
    <!-- 更新个人资料主体部分 end-->

  <%@include file="footer.jsp" %>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"电动汽车智能充电服务系统，想充就充，一键直达！","bdMini":"2","bdMiniList":false,"bdPic":"www.ezchong.com/pic/index-img1.png;www.ezchong.com/pic/index-img2.png;www.ezchong.com/pic/index-img3.png;","bdStyle":"0","bdSize":"16"},"slide":{"type":"slide","bdImg":"6","bdPos":"right","bdTop":"238.5"},"image":{"viewList":["weixin","tsina","qzone","tqq","renren","isohu"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["weixin","tsina","qzone","tqq","renren","isohu"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?c8b733648de5ad25d37a909cd546fbe3";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
        
    </div>


    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
   
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="../js/bootstrap.min.js"></script>

    <script type="text/javascript">
        $('#myTab a').click(function (e) {
            e.preventDefault()
            $(this).tab('show')
        })
        $(function(){
        	//查询所有消息
            $.ajax({
                type: "POST",
                dataType: "json",
                url: 'person/get_person_msg.do',
                success: function (data) {

                    var now_remind_list = data.NOW_REMIND_LIST;
                    var old_remind_list = data.OLD_REMIND_LIST;

                    if (now_remind_list.length == 0 ) {
                    	var html  = '<tr align="center">';
                            html += '<td>暂时无消息</td>';
                            html += '</tr>';
                        $("#msgContent").append(html);
                    }
                    if (old_remind_list.length == 0 ) {
                        var html  = '<tr align="center">';
                            html += '<td>暂时无消息</td>';
                            html += '</tr>';
                        $("#oldMsgContent").append(html);
                    }
                    $.each(now_remind_list, function(i, content){
                        var message = now_remind_list[i];
                        var html  = '<tr align="left">';
                            html += '<td>'+jsonDateFormat(message.createDate)+'</td>';
                            html += '<td>:'+message.messageMsg+'</td>';
                            html += '</tr>';
                        $("#msgContent").append(html);
                    });
                    $.each(old_remind_list, function(i, content){
                        var message = old_remind_list[i];
                        var html  = '<tr align="left">';
                            html += '<td>'+jsonDateFormat(message.createDate)+'</td>';
                            html += '<td>:'+message.messageMsg+'</td>';
                            html += '</tr>';
                        $("#oldMsgContent").append(html);
                    });
                },
                error: function(data) {
                    alert(data.responseText);
                 }
            });
        });
        function jsonDateFormat(jsonDate) {//json日期格式转换为正常格式
		    try {//出自http://www.cnblogs.com/ahjesus 尊重作者辛苦劳动成果,转载请注明出处,谢谢!
		        var date = new Date(jsonDate.time);
		        var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
		        var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
		        var hours = date.getHours();
		        var minutes = date.getMinutes();
		        var seconds = date.getSeconds();
		        var milliseconds = date.getMilliseconds();
		        return date.getFullYear() + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
		    } catch (ex) {//出自http://www.cnblogs.com/ahjesus 尊重作者辛苦劳动成果,转载请注明出处,谢谢!
		        return "";
		    }
		}
        
        
    </script>
</html>
